Page({
  data: {
    tabList: [
      '门店订单',
      '储值订单',
      '买单订单',
      '券包订单'
    ],
    currentTab: 0,
    storeOrders: []
  },
  onLoad() {},
  onShow() {
    // 只加载门店订单（可扩展类型筛选）
    const orders = wx.getStorageSync('orders') || [];
    this.setData({ storeOrders: orders });
  },
  onTabClick(e) {
    const idx = e.currentTarget.dataset.idx;
    this.setData({ currentTab: idx });
  },
  // 新增：点击订单卡片跳转详情
  onOrderCardTap(e) {
    const orderId = e.currentTarget.dataset.id;
    wx.navigateTo({
      url: `/pages/orderDetail/index?id=${orderId}`
    });
  }
}); 